<?php
$pdo = new PDO("mysql:host=192.168.10.123;port=13306;dbname=bbs", "root", "123456",[
    PDO::MYSQL_ATTR_INIT_COMMAND => "set names utf8"
]); // 使用new关键字进行对象实例化
$query = $pdo->query("select * from users");
foreach($query as $row){
    echo "姓名:{$row['username']} 年龄:{$row['age']} 性别:{$row['sex']} <br>";
}